require.config({
  baseUrl: '../assets/',
  paths: {
    jquery: ['https://code.jquery.com/jquery-3.2.1.min','jquery1.9.1.min'],
    validate: ['jquery.validate'],
    cropbox: ['upImg/js/cropbox-min'],
    chosen: ['select/chosen.jquery'],
    build: './yun',
    mock: ['mock','http://mockjs.com/dist/mock']
  },
  shim: {
    validate: {
      deps: ['jquery'],
      exports: ''
    },
    cropbox: {
      deps: ['jquery'],
      exports: ''
    },
    chosen: {
      deps: ['jquery'],
      exports: ''
    },
    build: {
      deps: ['jquery', 'mock', 'validate', 'cropbox', 'chosen'],
      exports: ''
    }
  }
});
require(['jquery', 'mock', 'validate', 'cropbox', 'chosen', 'src/js/yun'], function ($, Mock) {
  //ie低版本跳转
  +function () {
    var ua = navigator.userAgent.toLowerCase();
    if (ua.indexOf('msie') > -1) {
      var safariVersion = ua.match(/msie ([\d.]+)/)[1];
      if (parseInt(safariVersion) <= 8) {
        window.location.href = './updateBrowser.html';
      }
    }
  }();
  Mock.mock('a1', {
    'list|6': [{
      name: '@cname',
      title: '@cparagraph(1, 3)',
      time: '@date',
      imgurl: '@image'
    }]
  });
  Mock.mock('a2', {
    "Yname": "货运吞吐量(万吨)",
    "month": [
      "一月",
      "二月",
      "三月",
      "四月",
      "五月",
      "六月"
    ],
    "name": [
      {
        "name": "煤炭港区"
      },
      {
        "name": "综合港区"
      },
      {
        "name": "散货港区"
      },
      {
        "name": "河口港区"
      }
    ],
    "data": [
      {
        "name": "煤炭港区",
        "type": "bar",
        "itemStyle": {
          "normal": {
            "color": "#63ff96"
          }
        },
        "data": [
          67,
          4.9,
          7,
          23.2,
          85.6,
          76.7
        ]
      },
      {
        "name": "综合港区",
        "type": "bar",
        "itemStyle": {
          "normal": {
            "color": "#63e7ff"
          }
        },
        "data": [
          21,
          4.9,
          7,
          36.2,
          29.6,
          76.7
        ]
      },
      {
        "name": "散货港区",
        "type": "bar",
        "itemStyle": {
          "normal": {
            "color": "#ffd163"
          }
        },
        "data": [
          34,
          25.9,
          7,
          23.2,
          39.6,
          76.7
        ]
      },
      {
        "name": "河口港区",
        "type": "bar",
        "itemStyle": {
          "normal": {
            "color": "#ff4c4c"
          }
        },
        "data": [
          32,
          4.9,
          76,
          23.2,
          67.6,
          25.7
        ]
      }
    ]
  });
  $.ajax('a1', {
    dataType: 'json',
    success: function (data) {
      console.log(data)
    },
    error: function (err) {
      console.log(err);
    }
  });
  $.ajax('a2', {
    dataType: 'json',
    success: function (data) {
      console.log(data)
    },
    error: function (err) {
      console.log(err);
    }
  });
});